<template>
  <view class="search-box">
    <!-- <uni-icons style="margin-top: 5rpx;" @click="goBack" type="left" size="31"></uni-icons> -->
    <uni-easyinput style="margin-top: 10rpx;border-radius: 25rpx;"  class="uni-mt-5" suffixIcon="search" v-model="grope" placeholder="请输入搜索关键词" @iconClick="onSearch"></uni-easyinput>
  </view>
</template>

<script setup>
import { defineEmits, ref, defineProps,onMounted } from "vue";

const props = defineProps({
  title: {
    type: String,
    default: "搜索",
  },
  getSearchName:{
	  type:String,
	  default:""
  }
});
const grope = ref("sssss");
const emit = defineEmits(["on-search"]);
function goBack() {
  uni.navigateBack({
    delta: 1, // 返回的页面数，这里表示返回上一页
  });
}
function alteration(value) {
  console.log(value);
  // grope.value= event.mp.detail
}
function onSearch() {
  console.log(grope.value);
  emit("on-search", grope.value);
}
onMounted(()=>{
	grope.value=props.getSearchName
})
</script>

<style scoped lang="less">
.search-box {
  background-color: #f7f8fd;
  display: flex;
  align-items: center;
  .icon-title {
    color: #272636;
    font-family: "ali-m";
  }
}
</style>